package org.genitus.druidry

import in.zapr.druid.druidry.Interval
import in.zapr.druid.druidry.aggregator.DruidAggregator
import in.zapr.druid.druidry.dimension.DruidDimension
import in.zapr.druid.druidry.filter.DruidFilter
import in.zapr.druid.druidry.granularity.Granularity
import in.zapr.druid.druidry.postAggregator.DruidPostAggregator
import org.joda.time.DateTime

class DruidGroupByResponse[T<:DruidGroupByEvent](version:String,timestamp:String,event:T) {
  def getEvent:T = {
    this.event.timestamp = new DateTime(timestamp).getMillis
    this.event
  }
}

abstract class DruidGroupByEvent {
  var timestamp:Long = _
}

abstract class DruidGroupBySearch {
  def druidDataSource:String
  def druidDimensions:List[DruidDimension]
  def druidIntervals:List[Interval]
  def druidGranularity: Granularity

  def druidFilter: Option[DruidFilter] = None
  def druidAggregators: Option[List[DruidAggregator]] = None
  def druidPostAggregators: Option[List[DruidPostAggregator]] = None
}
